package com.zkt.weichat.handler;

import lombok.Getter;

/**
 * @author 赵开泰
 * @program jc-club
 * @date 2025/3/23 01:26
 * @description 微信消息类型枚举类
 **/

@Getter
public enum WeichatMsgTypeEnum {
	
	SUBSCRIBE("event.subscribe", "用户关注事件"),
	TEXT_MSG("text", "接收用户文本消息");
	
	private String msgType;
	private String desc;
	
	WeichatMsgTypeEnum(String msgType, String desc) {
		this.msgType = msgType;
		this.desc = desc;
	}
	
	public static WeichatMsgTypeEnum getByMsgType(String msgType) {
		for (WeichatMsgTypeEnum weichatMsgTypeEnum : WeichatMsgTypeEnum.values()) {
			if (weichatMsgTypeEnum.msgType.equals(msgType)) {
				return weichatMsgTypeEnum;
			}
		}
		return null;
	}
	
}
